const USER_ERROR_MSG = "USER_ERROR_MSG";
const ALOGIN_SUCCESS = "ALOGIN_SUCCESS";
const TLOGIN_SUCCESS = "TLOGIN_SUCCESS";
const SLOGIN_SUCCESS = "SLOGIN_SUCCESS";

const initialState = {};
// rxreducer
// rxaction
const user = (state = initialState, action) => {
  switch (action.type) {
    case ALOGIN_SUCCESS:
      return { ...state, type: 0, ...action.payload };
    case TLOGIN_SUCCESS:
      return { ...state, type: 1, ...action.payload };
    case SLOGIN_SUCCESS:
      return { ...state, type: 2, ...action.payload };
    
    case USER_ERROR_MSG:
      return { ...action.payload };
    default:
      return state;
  }
};
export default user;
